<?php



echo $this->render('/layouts/header');

?>
<div style="margin:auto 0px; margin-top:10px; width:1000px;"></div>

<?php
foreach($cates as $cate){
?>
<table align="center" width="1000" cellpadding="0" cellspacing="1" style="border:1px solid #CCC">
  <tr bgcolor="#EEE" height="24">
    <td colspan="4"><?php echo $cate["name"]?></td>
  </tr>
<?php

    $apis = \oauth2user\components\Category::getApis($cate["id"]);
    foreach($apis as $api){

        $link = isset($api["link"]) ? $api["link"] : "";

        if(empty($link)){
            $link = "/api/detail.html?uri=".$api["uri"];
            $url = $api["uri"];

        }else{
            $url = $link;
        }

        $method = isset($api["method"])  ? $api["method"] : "GET";


?>
  <tr bgcolor="#F9F9F9" height="24">
    <td width="260"><a href="<?php echo $link?>" target="_blank"><?php echo $api["name"]?></a></td>
    <td><?php echo $url?></a></td>
    <td><?php echo $method?></td>
  </tr>
<?php
  }
?>
</table>
<br>
<?php	
}

?>


</body>
</html>